<!DOCTYPE html>
<html lang="en">

<head>
     <meta charset="UTF-8">
     <title>教师栏</title>
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <link rel="stylesheet" href="./css/app.css">
     <link rel="stylesheet" href="css/jquery.mobile-1.4.5.min.css" />
     <script src="./js/jquery-1.12.4.min.js"></script>
     <script src="./js/jquery.mobile-1.4.5.min.js"></script>
     <script src="js/template.js"></script>
     <script src="js/jquery.form.js"></script>
     <script>
          var TEAID="9191003";
     </script>
</head>

<body>
     <!--------------------教师端-信息箱页面，班级页面----------------------->
     <div data-role="page" id="msg-class" data-theme="s">
          <script>
               $(document).on("pagecreate", "#msg-class", function () {
                    $(document).on("swiperight", "#msg-class", function (e) {
                         // We check if there is no open panel on the page because otherwise
                         // a swipe to close the left panel would also open the right panel (and v.v.).
                         // We do this by checking the data that the framework stores on the page element (panel: open).
                         if ($(".ui-page-active").jqmData("panel") !== "open") {
                              if (e.type === "swiperight") {
                                   $("#person").panel("open");
                              }
                         }
                    });
               });
               var go_index = function () {
                    window.self.location = "#index";
               }
          </script>
          <!--加载班级-->
          <script>
               $("#msg-class").on("pagebeforecreate", function (e) {
                    //TEAID = window.location.href.slice(-7);
                    var you_circle_icon;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_teacherimage"
                         , data: {
                              id: TEAID
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "text"
                         , success: function (data) {
                              you_circle_icon = data;
                         }
                    });
                    $("#circle_tea_icon").attr("src", you_circle_icon);
                    var receive_student_course;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_myClass"
                         , data: {
                              tea_id: TEAID
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "JSON"
                         , success: function (data) {
                              receive_student_course = data;
                         }
                    });
                    //alert(receive_student_course[3].c_name);
                    var course_data = {
                         list: receive_student_course
                    };
                    $("#teacher_course_ul").append(template("student_index", course_data));
               });
          </script>
          <!--班级渲染模板-->
          <script id="student_index" type="text/html"> {{each list as value i}}
               <li id={{value.m_id}}x{{value.c_id}}y{{value.grade}}>
                    <a onclick="window.location.href= '#msg-class-message?id={{value.m_id}}w{{value.c_id}}x{{value.m_name}}y{{value.c_name}}z{{value.grade}}';return false" data-transition="slidedown">
                         <!--a onclick="we(this)" data-transition="slidedown" --><img class="msg-li-header" src="./img/header-bottle.png" alt="" />
                         <h1 class="msg-li-name">{{value.c_name}}——{{value.grade}}{{value.m_name}}</h1> </a>
               </li> {{/each}} </script>
          <script>
               function we(self) {
                    var str = self.parentNode.id + "";
                    alert(str);
                    //alert(str.indexOf("a"));
                    alert(str.slice(0, str.indexOf("a")))
               }
          </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-fullscreen="true" data-theme="s">
               <div data-role="navbar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal" data-theme="l">
                              <a href="#person" data-role="button" class="nav_header_a" onclick="showPrivate()"><img id="circle_tea_icon" alt="个人中心" class="nav_header_img"></a>
                         </li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-theme="j"><a href="" data-role="button" class="ui-btn-active ui-state-persist">班级</a> <a href="#msg-group" data-role="button" data-transition="slide">群组</a></li>
                         <li></li>
                    </ul>
               </div>
          </div>
          <!------------------------------------------------------------------个人中心（首）------------------------------------------------------------->
          <div data-role="panel" id="person" data-theme="k" data-display="overlay">
               <script>
                    function go_index() {
                         window.location.href = "index.html";
                    }

                    function showPrivate() {
                         var myIcon;
                         $.ajax({
                              url: "http://123.206.198.158:9093/get_teacherimage"
                              , data: {
                                   id: TEAID
                              }
                              , cache: true
                              , async: false
                              , type: "POST"
                              , dataType: "text"
                              , success: function (data) {
                                   myIcon = data;
                              }
                         });
                         var myNick;
                         $.ajax({
                              url: "http://123.206.198.158:9093/get_teacherName"
                              , data: {
                                   id: TEAID
                              }
                              , cache: true
                              , async: false
                              , type: "POST"
                              , dataType: "text"
                              , success: function (data) {
                                   myNick = data;
                              }
                         });
                         $("#myImg").attr("src", myIcon);
                         $("#myNick").attr("value", myNick);
                    }
               </script>
               <script>
                    function ajaxTeaIconUP() {
                         $("#def_one").attr("value", TEAID);
                         var options = {
                              success: function (data) {
                                   alert("修改成功！");
                                   window.location.reload();
                              }
                         };
                         $("#changeIcon").ajaxSubmit(options);
                    }
               </script>
               <div class="choice_list">
                    <ul data-role="listview" data-inset="true">
                         <div class="img-center"> <img id="myImg" alt="头像" class="img-center-img"></div>
                         <input type="text" id="myNick" value="" contenteditable="false" readonly />
                         <li>
                              <div data-role="collapsible" data-inset="false" data-iconpos="none" data-mini="true">
                                   <h3>修改头像</h3>
                                   <form id="changeIcon" action="http://123.206.198.158:8080/webb/File/TeaUp" enctype="multipart/form-data" method="post">
                                        <input id="def_one" type="hidden" name="tea_id" value="" />
                                        <input type="file" data-mini="true" name="newStuIcon_input">
                                        <input type="button" data-mini="true" value="保存" onclick="ajaxTeaIconUP()"> </form>
                              </div>
                         </li>
                         <li>
                              <div data-role="collapsible" data-inset="false" data-iconpos="none" data-mini="true">
                                   <h3>关于APP</h3>
                                   <textarea readonly="readonly">一款极其方便的校园助手APP</textarea>
                              </div>
                         </li>
                         <li>
                              <div data-role="collapsible" data-inset="false" data-iconpos="none" data-mini="true">
                                   <h1>退出登录</h1>
                                   <button onclick="go_index()" data-mini="true">确认</button>
                              </div>
                         </li>
                    </ul>
               </div>
          </div>
          <!------------------------------------------------------------------个人中心（尾）------------------------------------------------------------->
          <div data-role="content">
               <div class="choice_list">
                    <ul id="teacher_course_ul" data-role="listview" data-inset="true" data-filter="true" data-filter-placeholder="搜索" data-icon="false"> </ul>
               </div>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar">
                    <ul>
                         <li><a href="#msg-class" data-icon="green-message1" class="ui-btn-active ui-state-persist">信息箱</a></li>
                         <li><a href="#post-official" data-icon="green-post2">海报栏</a></li>
                         <li><a href="#course-file" data-icon="green-lost2">课件屋</a></li>
                         <li><a href="#course" data-icon="green-course2">课程表</a></li>
                    </ul>
               </div>
          </div>
     </div>
     <!------------------------------------------------信息箱页面，课程消息页面----------------------------------------------------->
     <div data-role="page" id="msg-class-message" data-theme="s">
          <!--加载即时消息-->
          <script>
               $("#msg-class-message").on("pagebeforeshow", function (e) {
                    //alert(location.hash);
                    var msg_grade = location.hash.slice(location.hash.length - 4);
                    var msg_mid = location.hash.slice(22, location.hash.indexOf("w"));
                    var msg_cid = location.hash.slice(location.hash.indexOf("w") + 1, location.hash.indexOf("x"));
                    var msg_mname = location.hash.slice(location.hash.indexOf("x") + 1, location.hash.indexOf("y"));
                    var msg_cname = location.hash.slice(location.hash.indexOf("y") + 1, location.hash.indexOf("z"));
					//alert(msg_cid);
                    document.getElementById("show_courseGroup_Chat").innerHTML = "";
                    document.getElementById("groupName").innerHTML = msg_cname + "(" + msg_grade.slice(2, 5) + msg_mname + ")";
                    var receive_StudentGroup_chat;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_myClassMessage"
                         , data: {
                              c_id: msg_cid
                              , m_id: msg_mid
                              , grade: msg_grade
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "JSON"
                         , success: function (data) {
                              receive_StudentGroup_chat = data;
                              //alert(data);
                         }
                    });
                    var stuGroup_chat_data = {
                         list: receive_StudentGroup_chat
                    };
                    $("#show_courseGroup_Chat").append(template("studentIndex_groupTemplate", stuGroup_chat_data)).listview('refresh');
                    //$("#show_courseGroup_Chat").listview('refresh');
               });
          </script>
          <!--即时消息模板-->
          <script id="studentIndex_groupTemplate" type="text/html"> {{each list as value i}}
               <li>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#">     <img src={{value.icon}}>
                         <p>{{value.date}}</p>
                         <textarea readonly="readonly">{{value.chat}}</textarea>
                    </a>
               </li>{{/each}} </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal" data-theme="l"><a href="#msg-class" data-role="button" class="ui-btn ui-icon-green-back1 ui-btn-icon-notext">返回</a></li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" id="groupName">NULL</li>
                         <li data-role="controlgroup" data-type="horizontal"></li>
                    </ul>
               </div>
          </div>
          <div data-role="content" class="choice_list">
               <ul id="show_courseGroup_Chat" data-role="listview" data-icon="false"></ul>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <label for="message-send-input-content" class="ui-hidden-accessible">消息发送</label>
               <textarea type="text" name="message-send-input-content" id="message-send-input-content" cols="40" rows="2" class="message-send-input"></textarea>
               <button class="message-send-btn ui-btn-right" data-theme="l" onclick="send_left()">发送</button>
          </div>
          <!--群发送消息-->
          <script>
               function send_left() {
                    var msg_grade = location.hash.slice(location.hash.length - 4);
                    var msg_mid = location.hash.slice(22, location.hash.indexOf("w"));
                    var msg_cid = location.hash.slice(location.hash.indexOf("w") + 1, location.hash.indexOf("x"));
                    var msg_mname = location.hash.slice(location.hash.indexOf("x") + 1, location.hash.indexOf("y"));
                    var msg_cname = location.hash.slice(location.hash.indexOf("y") + 1, location.hash.indexOf("z"));
                    $.ajax({
                         url: "http://123.206.198.158:9093/addteachercoursemessage"
                         , data: {
                              id: TEAID
                              , grade: msg_grade
                              , m_id: msg_mid
                              , c_id: msg_cid
                              , chat: $("#message-send-input-content").val()
                         }
                         , cache: true
                         , async: false
                         , type: "post"
                         , success: function () {
                              document.getElementById("show_courseGroup_Chat").innerHTML = "";
                              document.getElementById("groupName").innerHTML = msg_cname + "(" + msg_grade.slice(2, 5) + msg_mname + ")";
                              var receive_StudentGroup_chat;
                              $.ajax({
                                   url: "http://123.206.198.158:9093/get_myClassMessage"
                                   , data: {
                                        c_id: msg_cid
                                        , m_id: msg_mid
                                        , grade: msg_grade
                                   }
                                   , cache: true
                                   , async: false
                                   , type: "POST"
                                   , dataType: "JSON"
                                   , success: function (data) {
                                        receive_StudentGroup_chat = data;
                                   }
                              });
                              var stuGroup_chat_data = {
                                   list: receive_StudentGroup_chat
                              };
                              $("#show_courseGroup_Chat").append(template("studentIndex_groupTemplate", stuGroup_chat_data)).listview('refresh');
                              $("#message-send-input-content").val("");
                         }
                    });
               }
          </script>
     </div>
     <!----------------------------信息箱页面,群组信息----------------------------->
     <div data-role="page" id="msg-group" data-theme="s">
          <!--加载讨论组消息-->
          <script>
               $("#msg-group").on("pagebeforecreate", function (e) {
                    var receive_discussion_group;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_teacherSinDiscussion"
                         , data: {
                              tea_id: TEAID
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "JSON"
                         , success: function (data) {
                              receive_discussion_group = data;
                         }
                    });
                    var discussion_data = {
                         list: receive_discussion_group
                    };
                    $("#discussion_group").append(template("discussion_template", discussion_data));
               });
          </script>
          <!--讨论组消息渲染模板-->
          <script id="discussion_template" type="text/html"> {{each list as value i}}
               <li>
                    <a onclick="window.location.href='#msg-group-message?id={{value.id}}z{{value.nname}}';return false" data-transition="slidedown"> <img src="./img/header-bottle.png" class="msg-li-header" alt="" />
                         <h1>{{value.nname}}</h1> </a>
               </li> {{/each}} </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-fullscreen="true" data-theme="s">
               <div data-role="navbar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal"></li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-theme="j"><a href="#msg-class" data-role="button" data-transition="slide" data-direction="reverse">班级</a> <a href="#" data-role="button" class="ui-btn-active ui-state-persist">群组</a></li>
                         <li class="msg-top-nav-head-right" data-role="controlgroup" data-type="horizontal" data-theme="l"><a href="#msg-group-create" class="ui-btn ui-icon-green-plus1 ui-btn-icon-notext ui-corner-all">创建</a></li>
                    </ul>
               </div>
          </div>
          <div data-role="content">
               <div class="choice_list">
                    <ul id="discussion_group" data-role="listview" data-inset="true" data-filter="true" data-icon="false"> </ul>
               </div>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar">
                    <ul>
                         <li><a href="#msg-class" data-icon="green-message1" class="ui-btn-active ui-state-persist">信息箱</a></li>
                         <li><a href="#post-official" data-icon="green-post2">海报栏</a></li>
                         <li><a href="#course-file" data-icon="green-lost2">课件屋</a></li>
                         <li><a href="#course" data-icon="green-course2">课程表</a></li>
                    </ul>
               </div>
          </div>
     </div>
     <!----------------------------信息箱页面,群组消息页面----------------------------->
     <div data-role="page" id="msg-group-message" data-theme="s">
          <!--加载讨论组即时消息-->
          <script>
               $("#msg-group-message").on("pagebeforecreate", function (e) {
                    var dis_id = location.hash.slice(location.hash.indexOf("id") + 3, location.hash.indexOf("z"));
                    var dis_name = location.hash.slice(location.hash.indexOf("z") + 1);
                    document.getElementById("communication").innerHTML = "";
                    document.getElementById("disgroup").innerHTML = dis_name;
                    var receive_StudentGroup_communication;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_myDisMessage"
                         , data: {
                              id: dis_id
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "JSON"
                         , success: function (data) {
                              receive_StudentGroup_communication = data;
                         }
                    });
                    var communication_chat_data = {
                         list: receive_StudentGroup_communication
                    };
                    $("#communication").append(template("communication_groupTemplate", communication_chat_data));
               });
          </script>
          <!--讨论组即时消息模板-->
          <script id="communication_groupTemplate" type="text/html"> {{each list as value i}}
               <li>
                    &nbsp;&nbsp;&nbsp;<a href="#"> <img src={{value.icon}}>
                         <p>{{value.date}}</p>
                         <textarea readonly="readonly">{{value.chat}}</textarea>
                    </a>
               </li>  {{/each}} </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal" data-theme="l"> <a data-role="button" data-rel="back" class="ui-btn ui-icon-green-back1 ui-btn-icon-notext">返回</a></li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" id="disgroup" data-theme="l" style="font-size: 1.3em">NULL</li>
                         <li></li>
                    </ul>
               </div>
          </div>
          <div data-role="content" class="choice_list">
               <ul id="communication" data-role="listview"> </ul>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <label for="message-send-input-content" class="ui-hidden-accessible">消息发送</label>
               <textarea type="text" name="message-send-input-content" id="message-group-send-input-content" cols="50" rows="4" class="message-send-input"></textarea>
               <button class="message-send-btn ui-btn-right" data-theme="l" onclick="send_right()">发送</button>
          </div>
          <!--讨论组发送消息-->
          <script>
               function send_right() {
                    var dis_id = location.hash.slice(location.hash.indexOf("id") + 3, location.hash.indexOf("z"));
                    var dis_name = location.hash.slice(location.hash.indexOf("z") + 1);
                    $.ajax({
                         url: "http://123.206.198.158:9093/add_DisChat"
                         , data: {
                              id: TEAID
                              , g_id: dis_id
                              , chat: $("#message-group-send-input-content").val()
                         }
                         , cache: true
                         , async: false
                         , type: "post"
                         , success: function () {
                              document.getElementById("communication").innerHTML = "";
                              document.getElementById("disgroup").innerHTML = dis_name;
                              var receive_StudentGroup_communication;
                              $.ajax({
                                   url: "http://123.206.198.158:9093/get_myDisMessage"
                                   , data: {
                                        id: dis_id
                                   }
                                   , cache: true
                                   , async: false
                                   , type: "POST"
                                   , dataType: "JSON"
                                   , success: function (data) {
                                        receive_StudentGroup_communication = data;
                                   }
                              });
                              var communication_chat_data = {
                                   list: receive_StudentGroup_communication
                              };
                              $("#communication").append(template("communication_groupTemplate", communication_chat_data)).listview('refresh');
                              $("#message-group-send-input-content").val("");
                         }
                    });
               }
          </script>
     </div>
     <!----------------------------信息箱页面,群组创建----------------------------->
     <div data-role="page" id="msg-group-create" data-theme="s">
          <!--加载师生资料-->
          <script>
               $("#msg-group-create").on("pagebeforecreate", function (e) {
                    var receive_material_data;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_groupNeed"
                         , data: {
                              tea_id: TEAID
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "JSON"
                         , success: function (data) {
                              receive_material_data = data;
                         }
                    });
                    //alert(receive_student_course[3].c_name);
                    var material_data = {
                         list: receive_material_data
                    };
                    $("#material_group").append(template("material_template", material_data));
               });
          </script>
          <!--师生资料渲染模板-->
          <script id="material_template" type="text/html"> {{each list as value i}}
               <li>
                    <label for={{value.id}}><span>{{value.name}}</span> <span>{{value.id}}</span> <span>{{value.s_name}}</span></label>
                    <input type="checkbox" name="data[]" value={{value.id}} id={{value.id}}> </li> {{/each}} </script>
					
				<script>
                    function ajaxStuIconUP22() {
                         var options = {
                              success: function (data) {
                                   alert("修改成功！");
                                   window.location.reload();
                              }
                         };
                         $("#changeIcon22").ajaxSubmit(options);
                    }
               </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal" data-theme="l"><a href="#" data-role="button" data-rel="back" class="ui-btn ui-icon-green-back1 ui-btn-icon-notext ui-corner-all">返回</a></li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-theme="l"><a href="#" data-role="button">讨论组创建</a></li>
                         <li class="msg-top-nav-head-right" data-role="controlgroup" data-type="horizontal"></li>
                    </ul>
               </div>
          </div>
          <div data-role="content">
               <div class="choice_list">
                    <form id="changeIcon22"action="http://123.206.198.158:9093/create_dis" enctype="multipart/form-data" method="post">		     
                         <input type="text" name="data[]" placeholder="请为您要创建的群组命名">
						 <input type="hidden" name="data[]" value="9191003" />
                         <input type="button" value="创建" class="lost-send-submit-btn" data-theme="l" data-mini="true" onclick="ajaxStuIconUP22()"/>
                         <fieldset data-role="controlgroup">
                              <ul id="material_group" data-role="listview" data-filter="true" data-filter-placeholder="搜索" class="choice_list" data-theme="a"> </ul>
                         </fieldset>
                    </form>
               </div>
          </div>
     </div>
     <!--                          溜金哇卡呀酷烈
                                 教师端-海报栏海报
        quu..__
         $$$b  `---.__
          "$$b        `--.                          ___.---uuudP
           `$$b           `.__.------.__     __.---'      $$$$"              .
             "$b          -'            `-.-'            $$$"              .'|
               ".                                       d$"             _.'  |
                 `.   /                              ..."             .'     |
                   `./                           ..::-'            _.'       |
                    /                         .:::-'            .-'         .'
                   :                          ::''\          _.'            |
                  .' .-.             .-.           `.      .'               |
                  : /'$$|           .@"$\           `.   .'              _.-'
                 .'|$u$$|          |$$,$$|           |  <            _.-'
                 | `:$$:'          :$$$$$:           `.  `.       .-'
                 :                  `"--'             |    `-.     \
                :##.       ==             .###.       `.      `.    `\
                |##:                      :###:        |        >     >
                |#'     `..'`..'          `###'        x:      /     /
                 \                                   xXX|     /    ./
                  \                                xXXX'|    /   ./
                  /`-.                                  `.  /   /
                 :    `-  ...........,                   | /  .'
                 |         ``:::::::'       .            |<    `.
                 |             ```          |           x| \ `.:``.
                 |                         .'    /'   xXX|  `:`M`M':.
                 |    |                    ;    /:' xXXX'|  -'MMMMM:'
                 `.  .'                   :    /:'       |-'MMMM.-'
                  |  |                   .'   /'        .'MMM.-'
                  `'`'                   :  ,'          |MMM<
                    |                     `'            |tbap\
                     \                                  :MM.-'
                      \                 |              .''
                       \.               `.            /
                        /     .:::::::.. :           /
                       |     .:::::::::::`.         /
                       |   .:::------------\       /
                      /   .''               >::'  /
                      `',:                 :    .'
                                           `:.:'-->
     <!----------------------教师端-海报栏海报栏页面-------------------->
     <div data-role="page" id="post" data-theme="s">
          <!------------------------------------------------------学生组织海报栏模板----------------------------------------------------------------------------->
          <script id="student_show_student_post" type="text/html"> {{each list as value i}}
               <li id="student_student_post_list{{i}}">
                    <div class="post-show-div">
                         <div class="post-show-div-inner-left"><img src={{value.icon}} alt=""></div>
                         <div class="post-show-div-inner-right">
                              <a href="#popup-post{{i+1}}" data-rel="popup" data-position-to="window" data-transition="flow"><img src={{value.pic}} alt=""></a>
                         </div>
                         <div data-role="popup" id="popup-post{{i+1}}" data-overlay-theme="s" data-corners="false"><a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-s ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a><img src={{value.pic}} alt=""></div>
                    </div>
               </li> {{/each}} </script>
          <!---------------------------------------------------学生组织海报栏渲染------------------------------------------------------>
          <script>
               $("#post").on("pagebeforecreate", function (e) {
                    var receive_post_data;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_studentnews"
                         , data: {}
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "JSON"
                         , success: function (data) {
                              receive_post_data = data;
                         }
                    });
                    var post_data = {
                         list: receive_post_data
                    };
                    $("#post_student_student_ul").append(template("student_show_student_post", post_data));
               });
          </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-fullscreen="true" data-theme="s">
               <div data-role="navbar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal">
                              <!--<a href="#person" class="ui-btn ui-icon-user ui-btn-icon-notext ui-corner-all">个人</a>--></li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-theme="j"><a href="#" class="ui-btn-active ui-state-persist">学生</a><a href="#post-official" data-transition="slide">校方</a></li>
                         <li></li>
                    </ul>
               </div>
          </div>
          <div data-role="content">
               <div class="choice_list">
                    <ul data-role="listview" data-inset="true" id="post_student_student_ul">
                         <!--模板区-->
                    </ul>
               </div>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar">
                    <ul>
                         <li><a href="#msg-class" data-icon="green-message2">信息箱</a></li>
                         <li><a href="#" data-icon="green-post1" class="ui-btn-active ui-state-persist">海报栏</a></li>
                         <li><a href="#course-file" data-icon="green-lost2">课件屋</a></li>
                         <li><a href="#course" data-icon="green-course2">课程表</a></li>
                    </ul>
               </div>
          </div>
     </div>
     <!--------------------------------------校方海报栏----------------------------------------------->
     <div data-role="page" id="post-official" data-theme="s">
          <!--校方海报栏模板-->
          <script id="student_show_school_post" type="text/html"> {{each list as value i}}
               <li id="student_school_post_list{{i}}">
                    <div class="post-show-div">
                         <div class="post-show-div-inner-left"><img src="{{value.icon}}" alt=""></div>
                         <div class="post-show-div-inner-right">
                              <a href="#popup_school_post{{i+1}}" data-rel="popup" data-position-to="window" data-transition="flow"><img src={{value.pic}} alt=""></a>
                         </div>
                         <div data-role="popup" id="popup_school_post{{i+1}}" data-overlay-theme="s" data-corners="false"><a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-s ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a><img src={{value.pic}} alt=""></div>
                    </div>
               </li> {{/each}} </script>
          <!--海报栏渲染-->
          <script>
               $("#post-official").on("pagebeforecreate", function (e) {
                    var receive_post_data;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_schoolnews"
                         , data: {}
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "JSON"
                         , success: function (data) {
                              receive_post_data = data;
                         }
                    });
                    var post_data = {
                         list: receive_post_data
                    };
                    $("#post_student_school_ul").append(template("student_show_school_post", post_data));
               });
          </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-fullscreen="true" data-theme="s">
               <div data-role="navbar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal">
                              <!--<a href="#person" class="ui-btn ui-icon-user ui-btn-icon-notext ui-corner-all">个人</a>--></li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-theme="j"><a href="#post" data-transition="slide" data-direction="reverse">学生</a><a href="#" class="ui-btn-active ui-state-persist">校方</a></li>
                         <li></li>
                    </ul>
               </div>
          </div>
          <div data-role="content">
               <div class="choice_list">
                    <ul data-role="listview" data-inset="true" id="post_student_school_ul">
                         <!--模板区-->
                    </ul>
               </div>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar">
                    <ul>
                         <li><a href="#msg-class" data-icon="green-message2">信息箱</a></li>
                         <li><a href="#" data-icon="green-post1" class="ui-btn-active ui-state-persist">海报栏</a></li>
                         <li><a href="#course-file" data-icon="green-lost2">课件屋</a></li>
                         <li><a href="#course" data-icon="green-course2">课程表</a></li>
                    </ul>
               </div>
          </div>
     </div>
     <!--
                      教师端-课件屋

                 ___====-_  _-====___
           _--^^^#####//      \\#####^^^--_
        _-^##########// (    ) \\##########^-_
       -############//  |\^^/|  \\############-
     _/############//   (@::@)   \\############\_
    /#############((     \\//     ))#############\
   -###############\\    (oo)    //###############-
  -#################\\  / VV \  //#################-
 -###################\\/      \//###################-
_#/|##########/\######(   /\   )######/\##########|\#_
|/ |#/\#/\#/\/  \#/\##\  |  |  /##/\#/  \/\#/\#/\#| \|
`  |/  V  V  `   V  \#\| |  | |/#/  V   '  V  V  \|  '
   `   `  `      `   / | |  | | \   '      '  '   '
                    (  | |  | |  )
                   __\ | |  | | /__
                  (vvv(VVV)(VVV)vvv)

                  ---->
     <!----------------------教师端-课件页面--------------------------->
     <!------------------------------------------课件管理页面-------------------------------------------------->
     <div data-role="page" id="course-file" data-theme="s">
          <!--加载已传课件-->
          <script>
               $("#course-file").on("pagebeforecreate", function (e) {
                    var files_data;
                    $.ajax({
                         url: "http://123.206.198.158:9093/get_all_files"
                         , data: {
                              tea_id: TEAID
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "JSON"
                         , success: function (data) {
                              files_data = data;
                         }
                    });
                    var file_data = {
                         list: files_data
                    };
                    $("#show_PPT").append(template("PPT_template", file_data));
               });
          </script>
          <!--已传课件展示模板-->
          <script id="PPT_template" type="text/html"> {{each list as value i}}
               <li>
                    <h class="lost-content-time">{{value.nname}}-----上传时间：{{value.date}}</h>
                    <p>{{value.remark}}</p>
                    <button id={{value.id}} onclick="delFile(this)" data-mini="true" data-inline="true" class="ui-btn-right" data-theme="l">删除</button>
               </li> {{/each}} </script>
          <script>
               function delFile(self) {
                    $.ajax({
                         url: "http://123.206.198.158:9093/del_a_file"
                         , data: {
                              f_id: self.id
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , success: function (data) {
                              alert("删除成功！");
                              window.location.reload();
                         }
                    });
               }
          </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-theme="s">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal"></li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-theme="l"><a>我的课件</a></li>
                         <li class="msg-top-nav-head-right" data-role="controlgroup" data-type="horizontal" data-theme="l"><a href="#course-file-upload" class="ui-btn ui-icon-green-tag1 ui-btn-icon-notext ui-corner-all">发布</a></li>
                    </ul>
               </div>
          </div>
          <div data-role="content">
               <div class="choice-list">
                    <ul id="show_PPT" data-role="listview" data-inset="true" data-filter="true" data-filter-placeholder="搜索课件" data-mini="true"> </ul>
               </div>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li><a href="#msg-class" data-icon="green-message2">信息箱</a></li>
                         <li><a href="#post-official" data-icon="green-post2">海报栏</a></li>
                         <li><a href="#" data-icon="green-lost1" class="ui-btn-active ui-state-persist">课件屋</a></li>
                         <li><a href="#course" data-icon="green-course2">课程表</a></li>
                    </ul>
               </div>
          </div>
     </div>
     <!-------------------------------------------------------课件上传页面------------------------------------------------>
     <div data-role="page" id="course-file-upload" data-theme="s">
          <!--加载教学对象-->
          <script>
               $("#course-file-upload").on("pagebeforecreate", function (e) {
                    var receive_object_data;
                    $.ajax({
                         url: "http://123.206.198.158:9093/getgrademajor"
                         , data: {
                              id: TEAID
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "JSON"
                         , success: function (data) {
                              receive_object_data = data;
                         }
                    });
                    var object_data = {
                         list: receive_object_data
                    };
                    $("#UP_PPT").append(template("object_template", object_data));
               });
          </script>
          <!--教学对象渲染模板-->
          <script id="object_template" type="text/html"> {{each list as value i}}
               <li>
                    <label for={{value.m_id}}{{value.grade}}>{{value.nname}}{{value.grade}}</label>
                    <input type="checkbox" name="data" value={{value.m_id}}{{value.grade}} id={{value.m_id}}{{value.grade}}> </li> {{/each}} </form>
          </script>
          <script>
               function ajaxFileUP() {
                    $("#def_two").attr("value", TEAID);
                    var options = {
                         success: function (data) {
                              alert("上传成功！");
							  window.history.go(-1);
							  window.location.reload();
                         }
                    };
                    $("#myForm").ajaxSubmit(options);
               }
          </script>
          <div data-role="header" data-tap-toggle="false" data-theme="s">
               <div data-role="navbar" class="top_nav_bar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal" data-theme="l"><a href="#course-file" class="ui-btn ui-icon-green-back1 ui-btn-icon-notext ui-corner-all">发布</a></li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal" data-theme="l"><a>课件上传</a></li>
                         <li class="msg-top-nav-head-right" data-role="controlgroup" data-type="horizontal" data-theme="l"></li>
                    </ul>
               </div>
          </div>
          <div data-role="content">
               <form id="myForm" action="http://123.206.198.158:8080/webb/File/FileUpload" enctype="multipart/form-data" method="post">
                    <input type="hidden" name="tea_id" value="" id="def_two" />
                    <fieldset data-role="fieldcontain" class="course-file-upload-type">
                         <div class="choice_list">
                              <ul id="UP_PPT" data-role="listview" data-theme="a" data-mini="false"> <span>发送班级:</span>
                                   <!--<li>
                                        <label for="xinxiguanli">信息管理</label>
                                        <input type="checkbox" name="xinxiguanli" id="xinxiguanli" value="xinxiguanli"> </li>
                                   <li>
                                        <label for="jisuanji">计算机科学与技术</label>
                                        <input type="checkbox" name="jisuanji" id="jisuanji" value="jisuanji"> </li>
                                   <li>
                                        <label for="ruanjian">软件工程</label>
                                        <input type="checkbox" name="ruanjian" id="ruanjian" value="ruanjian"> </li>
									-->
                              </ul>
                         </div> <span>课件备注:</span>
                         <input type="text" name="remark" placeholder="请输入对课件的补充，以便于您的学生查找并下载"> <span>课件选择:</span>
                         <input name="course-file-uploadfile" id="course-file-uploadfile" value="" type="file">
                         <input type="button" data-inline="true" value="上传" class="course-file-upload-submit-btn" data-mini="true" onclick="ajaxFileUP()"> </fieldset>
               </form>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true"></div>
     </div>
     <!--                           溜金哇卡呀酷烈
                                     教师端-课程表
        11111111111111111111111111111111111111001111111111111111111111111
        11111111111111111111111111111111111100011111111111111111111111111
        11111111111111111111111111111111100001111111111111111111111111111
        11111111111111111111111111111110000111111111111111111111111111111
        11111111111111111111111111111000000111111111111111111111111111111
        11111111111111111111111111100000011110001100000000000000011111111
        11111111111111111100000000000000000000000000000000011111111111111
        11111111111111110111000000000000000000000000000011111111111111111
        11111111111111111111111000000000000000000000000000000000111111111
        11111111111111111110000000000000000000000000000000111111111111111
        11111111111111111100011100000000000000000000000000000111111111111
        11111111111111100000110000000000011000000000000000000011111111111
        11111111111111000000000000000100111100000000000001100000111111111
        11111111110000000000000000001110111110000000000000111000011111111
        11111111000000000000000000011111111100000000000000011110001111111
        11111110000000011111111111111111111100000000000000001111100111111
        11111111000001111111111111111111110000000000000000001111111111111
        11111111110111111111111111111100000000000000000000000111111111111
        11111111111111110000000000000000000000000000000000000111111111111
        11111111111111111100000000000000000000000000001100000111111111111
        11111111111111000000000000000000000000000000111100000111111111111
        11111111111000000000000000000000000000000001111110000111111111111
        11111111100000000000000000000000000000001111111110000111111111111
        11111110000000000000000000000000000000111111111110000111111111111
        11111100000000000000000001110000001111111111111110001111111111111
        11111000000000000000011111111111111111111111111110011111111111111
        11110000000000000001111111111111111100111111111111111111111111111
        11100000000000000011111111111111111111100001111111111111111111111
        11100000000001000111111111111111111111111000001111111111111111111
        11000000000001100111111111111111111111111110000000111111111111111
        11000000000000111011111111111100011111000011100000001111111111111
        11000000000000011111111111111111000111110000000000000011111111111
        11000000000000000011111111111111000000000000000000000000111111111
        11001000000000000000001111111110000000000000000000000000001111111
        11100110000000000001111111110000000000000000111000000000000111111
        11110110000000000000000000000000000000000111111111110000000011111
        11111110000000000000000000000000000000001111111111111100000001111
        11111110000010000000000000000001100000000111011111111110000001111
        11111111000111110000000000000111110000000000111111111110110000111
        11111110001111111100010000000001111100000111111111111111110000111
        11111110001111111111111110000000111111100000000111111111111000111
        11111111001111111111111111111000000111111111111111111111111100011
        11111111101111111111111111111110000111111111111111111111111001111
        11111111111111111111111111111110001111111111111111111111100111111
        11111111111111111111111111111111001111111111111111111111001111111
        11111111111111111111111111111111100111111111111111111111111111111
        11111111111111111111111111111111110111111111111111111111111111111-->
     <!-----------------教师课程表-------------------------->
     <div data-role="page" id="course" data-theme="s">
          <script>
               function tableMerge(tableID, position) {
                    poi = "" + position;
                    var firstTd = "";
                    var currentTd = "";
                    var spanNum = 0;
                    $(tableID + " tr td:nth-child(" + poi + ")").slice(0).each(function (i) {
                         var temp = $(this);
                         if (temp.text() != "") {
                              if (i == 0) {
                                   firstTd = $(this);
                                   spanNum = 1;
                              }
                              else {
                                   currentTd = $(this);
                                   if (firstTd.text() == currentTd.text()) {
                                        spanNum++;
                                        currentTd.hide();
                                        firstTd.attr("rowSpan", spanNum);
                                   }
                                   else {
                                        firstTd = $(this);
                                        spanNum = 1;
                                   }
                              }
                         }
                    });
               }
          </script>
          <script>
               var course;
               $('#course').on('pagecreate', function (event) {
                    var URL = "";
                    switch ("teacher") {
                    case "student":
                         URL = "http://123.206.198.158:9093/get_studentcourse";
                         break;
                    case "teacher":
                         URL = "http://123.206.198.158:9093/get_teachercourse";
                         break;
                    }
                    $.ajax({
                         url: URL
                         , data: {
                              id: TEAID
                         }
                         , cache: true
                         , async: false
                         , type: "POST"
                         , dataType: "json"
                         , success: function (data) {
                              course = data;
                         }
                    });
                    if (course[0]["saturday"] == "false") {
                         $("#saturday").hide();
                         for (var j = 61; j <= 611; j++) {
                              var s = "#table" + j;
                              $(s).hide();
                              if ((j + 1) % 10 == 0) {
                                   j *= 10;
                                   j -= 81;
                              }
                         }
                    }
                    if (course[0]["sunday"] == "false") {
                         $("#sunday").hide();
                         for (var j = 71; j <= 711; j++) {
                              var s = "#table" + j;
                              $(s).hide();
                              if ((j + 1) % 10 == 0) {
                                   j *= 10;
                                   j -= 81;
                              }
                         }
                    }
                    if (course[0]["eleven"] == "false") {
                         $("#eleven").hide();
                    }
                    for (var i = 11; i <= 71; i += 10) {
                         for (var j = i; j <= i * 10 + 1; j++) {
                              var s = "#" + j;
                              if ((course[0][j] + "").slice(0, 2) == "单周") {
                                   $(s).attr("onclick", "a(this)");
                                   var temp = (course[0][j] + "").slice(0, course[0]["9" + j] - 6);
                                   $(s).append(temp);
                                   continue;
                              }
                              var s = "#table" + j;
                              if ((course[0][j] + "").slice(0, 2) == "单周") {
                                   $(s).attr("onclick", "a(this)");
                                   var temp = (course[0][j] + "").slice(0, course[0]["9" + j] - 6);
                                   $(s).append(temp);
                                   continue;
                              }
                              $(s).append(course[0][j]);
                              if ((j + 1) % 10 == 0) {
                                   j *= 10;
                                   j -= 81;
                              }
                         }
                    }
                    for (var i = 2; i < 9; i++) {
                         tableMerge("#timetable", i);
                    }
               });
          </script>
          <script>
               function a(self) {
                    var str = document.getElementById(self.id).innerHTML;
                    switch (str.slice(0, 2)) {
                    case "单周":
                         document.getElementById(self.id).innerHTML = (course[0][self.id] + "").slice(course[0]["9" + self.id]);
                         break;
                    case "双周":
                         document.getElementById(self.id).innerHTML = (course[0][self.id] + "").slice(0, course[0]["9" + self.id] - 6);
                         break;
                    }
               }
          </script>
          <div data-role="header" data-tap-toggle="false" data-position="fixed" data-fullscreen="true" data-theme="k">
               <div data-role="navbar">
                    <ul>
                         <li class="msg-top-nav-head" data-role="controlgroup" data-type="horizontal">
                              <!--<!--<a href="#person" class="ui-btn ui-icon-user ui-btn-icon-notext ui-corner-all">个人</a>--></li>
                         <li class="msg-top-nav" data-role="controlgroup" data-type="horizontal"><a>课程表</a></li>
                         <li></li>
                    </ul>
               </div>
          </div>
          <div data-role="content" class="choice_list">
               <table id="timetable" class="course-table" cellspacing="0px">
                    <thead>
                         <tr>
                              <th>课程</th>
                              <th>周一</th>
                              <th>周二</th>
                              <th>周三</th>
                              <th>周四</th>
                              <th>周五</th>
                              <th id="saturday">周六</th>
                              <th id="sunday">周日</th>
                         </tr>
                    </thead>
                    <tbody id="stu-course-table">
                         <tr>
                              <td>1</td>
                              <td id="table11" onclick=""></td>
                              <td id="table21" onclick=""></td>
                              <td id="table31" onclick=""></td>
                              <td id="table41" onclick=""></td>
                              <td id="table51" onclick=""></td>
                              <td id="table61" onclick=""></td>
                              <td id="table71" onclick=""></td>
                         </tr>
                         <tr>
                              <td>2</td>
                              <td id="table12" onclick=""></td>
                              <td id="table22" onclick=""></td>
                              <td id="table32" onclick=""></td>
                              <td id="table42" onclick=""></td>
                              <td id="table52" onclick=""></td>
                              <td id="table62" onclick=""></td>
                              <td id="table72" onclick=""></td>
                         </tr>
                         <tr>
                              <td>3</td>
                              <td id="table13" onclick=""></td>
                              <td id="table23" onclick=""></td>
                              <td id="table33" onclick=""></td>
                              <td id="table43" onclick=""></td>
                              <td id="table53" onclick=""></td>
                              <td id="table63" onclick=""></td>
                              <td id="table73" onclick=""></td>
                         </tr>
                         <tr>
                              <td>4</td>
                              <td id="table14" onclick=""></td>
                              <td id="table24" onclick=""></td>
                              <td id="table34" onclick=""></td>
                              <td id="table44" onclick=""></td>
                              <td id="table54" onclick=""></td>
                              <td id="table64" onclick=""></td>
                              <td id="table74" onclick=""></td>
                         </tr>
                         <tr>
                              <td>5</td>
                              <td id="table15" onclick=""></td>
                              <td id="table25" onclick=""></td>
                              <td id="table35" onclick=""></td>
                              <td id="table45" onclick=""></td>
                              <td id="table55" onclick=""></td>
                              <td id="table65" onclick=""></td>
                              <td id="table75" onclick=""></td>
                         </tr>
                         <tr>
                              <td>6</td>
                              <td id="table16" onclick=""></td>
                              <td id="table26" onclick=""></td>
                              <td id="table36" onclick=""></td>
                              <td id="table46" onclick=""></td>
                              <td id="table56" onclick=""></td>
                              <td id="table66" onclick=""></td>
                              <td id="table76" onclick=""></td>
                         </tr>
                         <tr>
                              <td>7</td>
                              <td id="table17" onclick=""></td>
                              <td id="table27" onclick=""></td>
                              <td id="table37" onclick=""></td>
                              <td id="table47" onclick=""></td>
                              <td id="table57" onclick=""></td>
                              <td id="table67" onclick=""></td>
                              <td id="table77" onclick=""></td>
                         </tr>
                         <tr>
                              <td>8</td>
                              <td id="table18" onclick=""></td>
                              <td id="table28" onclick=""></td>
                              <td id="table38" onclick=""></td>
                              <td id="table48" onclick=""></td>
                              <td id="table58" onclick=""></td>
                              <td id="table68" onclick=""></td>
                              <td id="table78" onclick=""></td>
                         </tr>
                         <tr>
                              <td>9</td>
                              <td id="table19" onclick=""></td>
                              <td id="table29" onclick=""></td>
                              <td id="table39" onclick=""></td>
                              <td id="table49" onclick=""></td>
                              <td id="table59" onclick=""></td>
                              <td id="table69" onclick=""></td>
                              <td id="table79" onclick=""></td>
                         </tr>
                         <tr>
                              <td>10</td>
                              <td id="table110" onclick=""></td>
                              <td id="table210" onclick=""></td>
                              <td id="table310" onclick=""></td>
                              <td id="table410" onclick=""></td>
                              <td id="table510" onclick=""></td>
                              <td id="table610" onclick=""></td>
                              <td id="table710" onclick=""></td>
                         </tr>
                         <tr id="eleven">
                              <td>11</td>
                              <td id="table111" onclick=""></td>
                              <td id="table211" onclick=""></td>
                              <td id="table311" onclick=""></td>
                              <td id="table411" onclick=""></td>
                              <td id="table511" onclick=""></td>
                              <td id="table611" onclick=""></td>
                              <td id="table711" onclick=""></td>
                         </tr>
                    </tbody>
                    <tfoot> </tfoot>
               </table>
          </div>
          <div data-role="footer" data-tap-toggle="false" data-position="fixed" data-fullscreen="true">
               <div data-role="navbar">
                    <ul>
                         <li><a href="#msg-class" data-icon="green-message2">信息箱</a></li>
                         <li><a href="#post-official" data-icon="green-post2">海报栏</a></li>
                         <li><a href="#course-file" data-icon="green-lost2">课件屋</a></li>
                         <li><a href="#" data-icon="green-course1">课程表</a></li>
                    </ul>
               </div>
          </div>
     </div>
</body>

</html>
